package com.kxc.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.kxc.entity.HisData;

/**
 * 测点历史数据 数据层
 * 
 */
public interface HisDataDao extends JpaRepository<HisData,Long>,JpaSpecificationExecutor<HisData> {

	public HisData findByPointNum(String pointNum);
	public List<HisData> findByMoniItem(String moniItem);
	
	@Modifying
	@Query(value = "SELECT * FROM hisdata WHERE point_num=?1 and collect_time>=?2 AND collect_time <?3 order by collect_time desc"  ,nativeQuery = true)
	public List<HisData> findLastData(String pointNum,String startTime,String endTime);
}
